package top.cluski.feieprint.api.youzan.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
public class TradeOrderRespEntity {
    private String trace_id;
    private int code;
    private DataResponse data;
    private boolean success;
    private String message;


    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class DataResponse {
        private List<FullOrderInfoList> full_order_info_list;
        private int total_results;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class FullOrderInfoList {
        private FullOrderInfo full_order_info;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class FullOrderInfo {
        private AddressInfo address_info;
        private RemarkInfo remark_info;
        private List<Order> orders;
        private OrderInfo order_info;
        private PayInfo pay_info;
        private SourceInfo source_info;
    }

    @Data
    public static class SourceInfo{
        private boolean is_offline_order;
        private String book_key;
        private String bizSource;
        private Source source;
        private String order_mark;
    }

    @Data
    public static class Source {
        private String platform;
        private String wx_entrance;
    }

    @Data
    public static class PayInfo {
        private int deduction_real_pay;
        private List<String> outer_transactions;
        private String pay_way_desc;
        private String pay_way_str;
        private String real_payment;
        private String post_fee;
        private int deduction_pay;
        private List<String> phase_payments;
        private String total_fee;
        private String payment;
        private int pay_way;
        private List<String> transaction;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class AddressInfo {
        private String self_fetch_info;
        private String delivery_address;
        private String delivery_start_time;
        private String delivery_end_time;
        private String delivery_postal_code;
        private String receiver_name;
        private String delivery_province;
        private String delivery_city;
        private String delivery_district;
        private String address_extra;
        private String receiver_tel;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class OrderInfo {
        private String consign_time;
        private String created;
        private String expired_time;
        private String status_str;
        private String success_time;
        private int type;
        private String shop_name;
        private String tid;
        private String confirm_time;
        private String pay_time;
        private long node_kdt_id;
        private String update_time;
        private String pay_type_str;
        private boolean is_retail_order;
        private int pay_type;
        private int team_type;
        private int refund_state;
        private long root_kdt_id;
        private int close_type;
        private TradeStatus status;
        private int express_type;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class RemarkInfo {
        private String buyer_message;
        private String trade_memo;
    }

    @Data
    public static class Order {
        private String is_cross_border;
        private String outer_item_id;
        private int item_type;
        private String discount_price;
        private int num;
        private String oid;
        private String title;
        private String fenxiao_payment;
        private String item_no;
        private String buyer_messages;
        private String root_sku_id;
        private boolean is_present;
        private String cross_border_trade_mode;
        private String price;
        private String sub_order_no;
        private String total_fee;
        private String fenxiao_price;
        private String alias;
        private String payment;
        private String is_pre_sale;
        private String item_barcode;
        private String outer_sku_id;
        private String sku_unique_code;
        private String goods_url;
        private String customs_code;
        private long item_id;
        private String weight;
        private long sku_id;
        private String sku_properties_name;
        private String pic_path;
        private String shop_org_id;
        private boolean is_combo;
        private String pre_sale_type;
        private String points_price;
        private String sku_no;
        private String root_item_id;
        private String sku_barcode;
        private String item_props;
    }


    public enum TradeStatus {
        WAIT_BUYER_PAY,
        TRADE_PAID,
        WAIT_CONFIRM,
        WAIT_SELLER_SEND_GOODS,
        WAIT_BUYER_CONFIRM_GOODS,
        TRADE_SUCCESS,
        TRADE_CLOSED
    }
}
